<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <h1>当前计数:{{counter}}</h1>
    <!--    <button v-on:click="counter++">+</button>-->
    <!--    <button v-on:click="counter&#45;&#45;">-</button>-->
    <button v-on:click="increment">+</button>
    <button v-on:click="sub">-</button>
    <h2 class="aaa" :class="[an,bn]">1111</h2>
    <h2 class="aaa" :class="getClasses()">1111</h2>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.5.16/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            counter: 0,
            an: '1111',
            bn: '22222'
        },
        methods: {
            getClasses: function () {
                return [this.an,this.bn]
            }
        }
    })
</script>
</html>
